package com.itheima.demo01;

public class Animal {
    //动物类

    //1.定义类名 见名知意

    //2.定义私有成员变量
    private int age;//年龄
    private String color;//颜色

    //3.定义空参构造、全部参数构造

    public Animal() {
    }

    public Animal(int age, String color) {
        this.age = age;
        this.color = color;
    }
    //4.定义成员方法set/get方法


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public void eat(String something){
        System.out.println("吃" + something);
    }

}
